.stage-wrap {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 0;
  margin: 0;
  width: calc(74% - 5px);

  @include breakpoint('phone-lrg') {
    width: calc(100% - 64px);
  }

  &.empty {
    border: 3px dashed $grey-light;
    background-color: $empty-stage-color;
    &::after {
      content: attr(data-content);
      position: absolute;
      text-align: center;
      top: 50%;
      left: 0;
      width: 100%;
      margin-top: -1em;
    }
  }
}

.frmb {
  list-style-type: none;
  min-height: 200px;
  transition: background-color 500ms ease-in-out;

  .formbuilder-required {
    color: $error;
  }

  &.removing {
    overflow: hidden;
  }

  li.form-field {
    &:hover {
      .field-actions {
        opacity: 1;
      }

      border-color: #66afe9;
      outline: 0;
      box-shadow:
        inset 0 1px 1px rgba(0, 0, 0, 0.1),
        0 0 8px rgba(102, 175, 233, 0.6);

      li {
        :hover {
          background: #fefefe;
        }
      }
    }
  }

  li.form-field {
    position: relative;
    padding: 6px;
    clear: both;
    margin-left: 0;
    margin-bottom: 3px;
    background-color: $white;
    transition:
      background-color 250ms ease-in-out,
      margin-top 400ms;

    &.hidden-field {
      background-color: $hidden-field-bgcolor;
    }

    &:first-child {
      border-top-right-radius: 5px;
      border-top-left-radius: 5px;

      .field-actions {
        .btn:last-child {
          border-radius: 0 5px 0 0;
        }
      }
    }

    &:last-child {
      border-bottom-right-radius: 5px;
      border-bottom-left-radius: 5px;
    }

    &.no-fields label {
      font-weight: 400;
    }

    @keyframes PLACEHOLDER {
      0% {
        height: 0;
      }

      100% {
        height: 15px;
      }
    }

    &.frmb-placeholder,
    &.ui-state-highlight {
      height: 0;
      padding: 0;
      background: radial-gradient(ellipse at center, rgba(84, 84, 84, 1) 0%, rgba(0, 0, 0, 0) 75%);
      border: 0 none;
      clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
      visibility: visible;
      overflow: hidden;
      margin-bottom: 3px;
      animation: PLACEHOLDER 250ms forwards;
    }

    &.moving,
    &.ui-sortable-helper {
      transition: box-shadow 500ms ease-in-out;
      box-shadow: 2px 2px 6px 0 $grey;
      border: 1px solid $white;
      border-radius: 5px;
    }

    &.disabled-field {
      z-index: 1;
      position: relative;
      overflow: visible;

      &:hover {
        .frmb-tt {
          display: inline-block;
        }
      }

      [type='checkbox'] {
        float: left;
        margin-right: 10px;
      }

      h2 {
        border-bottom: 0 none;
      }

      label {
        font-size: 12px;
        font-weight: 400;
        color: $grey;
      }

      .prev-holder {
        cursor: default;
        line-height: 28px;
        padding-left: 5px;
      }
    }

    .close-field {
      position: absolute;
      color: $grey;
      left: 50%;
      bottom: 6px;
      background: $white;
      border-top: 1px solid $input-border-color;
      border-left: 1px solid $input-border-color;
      border-right: 1px solid $input-border-color;
      transform: translateX(-50%);
      padding: 0 5px;
      border-top-right-radius: 3px;
      border-top-left-radius: 3px;
      cursor: pointer;
      transition: background-color 250ms ease-in-out;

      &:hover {
        text-decoration: none;
      }
    }

    &.header-field {
      h1,
      h2,
      h3,
      h4,
      h5,
      h6 {
        word-break: break-word;
      }
    }

    &.paragraph-field {
      p {
        word-break: break-word;
      }
    }

    .field-label {
      display: inline;
      overflow-wrap: break-word;
    }

    &.button-field,
    &.header-field,
    &.paragraph-field {
      h1,
      h2,
      h3,
      p,
      canvas,
      output,
      address,
      blockquote,
      .prev-holder {
        margin: 0;
      }

      .field-label {
        display: none;
      }

      &.editing {
        .field-label {
          display: block;
        }
      }
    }

    &.paragraph-field {
      .fld-label {
        min-height: 150px;
        overflow-y: auto;
      }
    }

    &.checkbox-field {
      .field-label {
        display: none;
      }
    }
  }

  li.deleting,
  li.delete:hover,
  li:hover li.delete:hover {
    background-color: #fdd;

    .close-field {
      background-color: #fdd;
    }
  }

  li.deleting {
    z-index: 20;
    pointer-events: none;
  }

  &.disabled-field {
    padding: 0 5px;

    :hover {
      border-color: transparent;
    }

    .form-element {
      float: none;
      margin-bottom: 10px;
      overflow: visible;
      padding: 5px 0;
      position: relative;
    }
  }

  .frm-holder {
    display: none;
  }

  .tooltip {
    left: 20px;
  }

  .prev-holder {
    display: block;

    .form-group {
      margin: 0;
    }

    .ql-editor {
      min-height: 125px;
    }

    .form-group > label:not([class='formbuilder-checkbox-label']) {
      display: none;
    }

    select,
    input[type='text'],
    textarea,
    input[type='number'] {
      background-color: $white;
      border: 1px solid $grey-light;
      box-shadow: inset 0 1px 1px $input-box-shadow-color;
    }

    input[type='color'] {
      width: 60px;
      padding: 2px;
      display: inline-block;
    }

    input[type='date'] {
      width: auto;
    }

    select[multiple] {
      height: auto;
    }

    label {
      font-weight: normal;
    }

    input[type='number'] {
      width: auto;
      max-width: 100%;
    }

    input[type='color'] {
      width: 60px;
      padding: 2px;
      display: inline-block;
    }
  }

  .required-asterisk {
    display: none;
  }

  .field-label,
  .legend {
    color: $grey;
    margin-bottom: 5px;
    line-height: 27px;
    font-size: 16px;
    font-weight: normal;
  }

  .disabled-field .field-label {
    display: block;
  }

  .other-option:checked + label {
    input {
      display: inline-block;
    }
  }

  .other-val {
    margin-left: 5px;
    display: none;
  }

  .field-actions {
    position: absolute;
    top: 0;
    right: 0;
    opacity: 0;

    a {
      &::before {
        margin: 0;
      }
      &:hover {
        text-decoration: none;
        color: #000;
      }
    }

    .btn {
      display: inline-block;

      width: 32px;
      height: 32px;
      padding: 0 6px;
      border-radius: 0;
      border-color: $input-border-color;
      background-color: $white;
      color: $input-border-color;
      line-height: 32px;
      font-size: 16px;
      border-width: 0 0 1px 1px;

      &:first-child {
        border-bottom-left-radius: 5px;
      }
    }

    .toggle-form {
      &:hover {
        border-color: lighten($grey, 40%);
        background-color: $edit;
        color: $white;
      }

      &::before {
        margin: 0;
      }
    }

    .copy-button {
      &:hover {
        background-color: $copy;
        color: $white;
      }
    }

    .del-button {
      &:hover {
        background-color: $remove;
        color: $white;
      }
    }
  }

  .option-actions {
    text-align: right;
    margin-top: 10px;
    width: 100%;
    margin-left: 2%;

    button,
    a {
      background: $white;
      padding: 5px 10px;
      border: 1px solid $input-border-color;
      font-size: 14px;
      border-radius: 5px;
      cursor: default;
    }
  }

  .sortable-options-wrap {
    width: 81.33333333%;
    display: inline-block;

    label {
      font-weight: normal;
    }

    @include breakpoint('phone-lrg') {
      display: block;
      width: 100%;
    }
  }

  .radio-group-field,
  .select-field {
    .sortable-options li:nth-child(2) .remove {
      opacity: 0;
      pointer-events: none;
    }
  }

  .sortable-options {
    display: inline-block;
    width: 100%;
    margin-left: 2%;
    background: $input-border-color;
    margin-bottom: 0;
    border-radius: 2px;
    list-style: none;
    padding: 0;

    > li {
      display: flex !important;
      flex-wrap: wrap;

      cursor: move;
      margin: 1px;

      padding: 6px;
      background-color: $white;

      &:nth-child(1) .remove {
        opacity: 0;
        pointer-events: none;
      }

      .remove {
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 1;
        width: 18px;
        font-size: 12px;
        padding: 0;
        color: $error;
        margin-left: 3px;
        &::before {
          margin: 0;
        }

        &:hover {
          background-color: $error !important;
          text-decoration: none;
          color: $white;
        }
      }
    }

    .option-selected {
      margin: 0 3px 0 0;
      flex: none;
    }

    input[type='text'] {
      flex-grow: 1;
      flex-shrink: 0;
      flex-basis: auto;
      width: 100px;
      margin: 0 3px;
      float: none;
    }
  }

  .form-field {
    .form-group {
      width: 100%;
      clear: left;
      float: none;
    }
  }

  .col-md-6,
  .col-md-8 {
    .form-elements {
      width: 100%;
    }
  }

  .field-options .add-area .add {
    clear: both;
  }

  .style-wrap {
    button {
      &.selected {
        border: 1px solid $black;
        margin-top: 0;
        margin-right: 1px;
        box-shadow: 0 0 0 1px $white inset;
        padding: 1px 5px;
      }
    }
  }

  .form-elements {
    padding: 10px 5px;
    background: #f7f7f7;
    border-radius: 3px;
    margin: 0;
    border: 1px solid $input-border-color;

    .input-wrap,
    .input-group-wrap {
      width: 81.33333333%;
      margin-left: 2%;

      > input[type='checkbox'] {
        margin-top: 8px;
      }
    }

    .btn-group {
      margin-left: 2%;
    }

    .add {
      clear: both;
    }

    [contenteditable],
    select[multiple] {
      height: auto;
    }

    [contenteditable].form-control {
      display: inline-block;
    }

    [contenteditable].form-control,
    input[type='text'],
    input[type='number'],
    input[type='date'],
    input[type='color'],
    textarea,
    select {
      transition: background 250ms ease-in-out;
      padding: 6px 12px;
      border: 1px solid $input-border-color;
      background-color: $white;
    }

    @include breakpoint('phone-lrg') {
      .input-wrap {
        width: 100%;
        margin-left: 0;
      }
    }

    input[type='number'] {
      width: auto;
    }

    .false-label,
    label {
      .col-md-6 &,
      .col-md-8 & {
        display: block;
      }

      &:first-child {
        width: 16.66666667%;
        padding-top: 7px;
        margin-bottom: 0;
        text-align: right;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-transform: capitalize;

        @include breakpoint('phone-lrg') {
          display: block;
          width: auto;
          text-align: left;

          &.empty-label {
            display: none;
          }
        }
      }

      &.multiple,
      &.required-label,
      &.toggle-label,
      &.roles-label,
      &.other-label {
        text-align: left;
        margin-bottom: -3px;
        font-weight: 400;
        width: calc(81.3333% - 23px);
      }
    }

    .input-group-wrap {
      display: flex;
      gap: 2em;

      label {
        width: auto;
        display: block;
        text-align: left;
      }

      .form-group {
        flex-direction: column;
        width: auto;
      }

      .input-wrap {
        margin: 0;
      }
    }

    input {
      &.error {
        border: 1px solid $error;
      }

      &.fld-maxlength,
      &.fld-rows {
        width: 75px;
      }

      &.field-error {
        background: $off-white;
        border: 1px solid $input-border-color;
      }
    }

    label {
      em {
        display: block;
        font-weight: 400;
        font-size: 0.75em;
      }

      &.maxlength-label {
        line-height: 1em;
      }
    }

    .available-roles {
      display: none;
      padding: 10px;
      margin: 10px 0;
      background: darken($white, 10%);
      box-shadow: inset 0 0 2px 0 $grey-light-30;

      @include breakpoint('phone-lrg') {
        margin-left: 0;
      }

      label {
        font-weight: 400;
        width: auto;
        float: none;
        display: inline;
      }

      input {
        display: inline;
        top: auto;
      }
    }
  }
}

.autocomplete-field {
  .sortable-options {
    .option-selected {
      display: none;
    }
  }
}

@at-root #{selector-append(".formbuilder-mobile", &)} {
  .field-actions {
    opacity: 1;
  }
}

/*   ------------   Toast Message   ------------   */
.snackbar {
  visibility: hidden; /* Hidden by default. Visible on click */
  min-width: 250px; /* Set a default minimum width */
  margin-left: -125px; /* Divide value of min-width by 2 */
  background-color: #333; /* Black background color */
  color: #fff; /* White text color */
  text-align: center; /* Centered text */
  border-radius: 2px; /* Rounded borders */
  padding: 16px; /* Padding */
  position: fixed; /* Sit on top of the screen */
  z-index: 1; /* Add a z-index if needed */
  left: 50%; /* Center the snackbar */
  bottom: 30px; /* 30px from the bottom */
}

.snackbar.show {
  visibility: visible;
  -webkit-animation:
    fadein 0.5s,
    fadeout 0.5s 2.5s;
  animation:
    fadein 0.5s,
    fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }
  to {
    bottom: 30px;
    opacity: 1;
  }
}

@keyframes fadein {
  from {
    bottom: 0;
    opacity: 0;
  }
  to {
    bottom: 30px;
    opacity: 1;
  }
}

@-webkit-keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }
  to {
    bottom: 0;
    opacity: 0;
  }
}

@keyframes fadeout {
  from {
    bottom: 30px;
    opacity: 1;
  }
  to {
    bottom: 0;
    opacity: 0;
  }
}
/*   ------------   END TOOLTIP   ------------   */

.ui-state-highlight {
  border-radius: 3px;
  border: 1px dashed #0d99f2;
  background-color: #e5f5f8;
  width: 12px;
}

.moveHighlight {
  border: 1px dashed #0d99f2 !important;
  background-color: #e5f5f8 !important;
}

.currentGridModeFieldHighlight {
  background-color: #e5f5f8 !important;
}

.grid-mode-help {
  background-color: $white;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.grid-mode-help-row1 {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 1px;
}
.grid-mode-help-row2 {
  white-space: nowrap;
}

.colWithInsertButtons {
  padding-left: 0 !important;
  padding-right: 0 !important;
  flex: 95 1 0% !important;
}

.rowWrapper {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.rowWrapper:last-child {
  flex-grow: 1;
}

.rowWrapper:not(.tempRowWrapper) {
  padding-top: 1em;
  padding-bottom: 1em;
}

.btnAddControl {
  border: 0;
  background-color: unset;
}

.hoverColumnDropStyle {
  border: 1px dashed #0d99f2;
  border-radius: 3px;
  background-color: #e5f5f8;
  width: 20px;
  position: fixed;
  margin-left: 40px;
}

.hoverDropStyleInverse {
  background-color: #0d99f2;
  border: 1px dashed #e5f5f8;
  min-height: 20px;
}

.hoverDropStyleInverse .colWrapper {
  max-width: calc(100% - 40px);
}

.stage-wrap > .hoverDropStyleInverse {
  width: 100%;
}

.rowWrapper > .hoverDropStyleInverse {
  min-width: 40px;
  flex-grow: 1;
}

.hoverDropStyleInverse:last-child {
  flex-grow: 1;
}

.invisibleRowPlaceholder {
  width: 0 !important;
  position: fixed !important;
  left: -100px !important;
}

ol.options-no-select input[type='radio'] {
  display: none;
}

.hidden {
  display: none !important;
}
.flex {
  display: flex !important;
}
